<?php

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();


    class Bootstrap extends Zend_Application_Bootstrap_Bootstrapcation_ {
        
        public function _initViewHelpers() {
            
        }
        
        protected function _initAutoLoad() {
            $modelLoader = new Zend_Application_Module_Autoloader(array(
                'namespace' => '',
                'basePath' => APPLICATION_PATH
            ));
            
            $acl = new Model_LibraryAcl();
            $auth = Zend_Auth::getInstance();
            
            $fc = Zend_Controller_Front::getInstance();
            $fc->registerPlugin(new Plugin_AccesCheck($acl, $auth));
                    
            return $modelLoader;
        }
    }